import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm';

@Entity({ name: 'error_lianlu' })
export class ErrorLianlu extends BaseEntity {
  @PrimaryGeneratedColumn({ type: 'int', name: 'id', comment: 'id' })
  id: number;
  @Column({
    type: 'varchar',
    name: 'lianlu_code',
    comment: '链路编号',
  })
  lianlu_code: string;
  @Column({
    type: 'varchar',
    name: 'lianlu_name',
    comment: '链路名称',
  })
  lianlu_name: string;
  @Column({
    type: 'varchar',
    name: 'lianlu_start',
    comment: '源端数据库',
  })
  lianlu_start: string;
  @Column({
    type: 'varchar',
    name: 'lianlu_end',
    comment: '目标端数据库',
  })
  lianlu_end: string;
  @Column({
    type: 'datetime',
    name: 'error_time_start',
    comment: '问题发现时间',
  })
  error_time_start: Date;
  @Column({
    type: 'datetime',
    name: 'error_time_end',
    nullable: true,
    comment: '问题解决时间',
  })
  error_time_end: Date;
  @Column({
    type: 'varchar',
    name: 'error_reason',
    nullable: true,
    comment: '问题简要原因',
  })
  error_reason: string;
  @Column({
    type: 'varchar',
    name: 'plan_error',
    comment: '计划内升级或故障',
  })
  plan_error: string;
  @Column({
    type: 'date',
    name: 'record_date',
    comment: '日期',
  })
  record_date: Date;
}
